import csv, os

os.makedirs("headerRemoved", exist_ok=True)

result = os.listdir(".")
print(result)

for fileName in os.listdir("."):
    if not fileName.endswith(".csv"):
        continue
    print("removing header from " + fileName + "...")

    csvRows = []
    with open(fileName) as fileObj:
        readerObj = csv.reader(fileObj)
        for row in readerObj:
            if readerObj.line_num == 1:
                continue
            csvRows.append(row)

    with open(os.path.join("headerRemoved", fileName), "w", newline="") as csvFileObj:
        csvWriter = csv.writer(csvFileObj)
        for row in csvRows:
            csvWriter.writerow(row)
if __name__ == "__main__":
    pass
